<template>
  <div>
    <el-page-header @back="goBack" content="详情页面"> </el-page-header>
    <div class="box">
    <div>
    <el-form
      :label-position="labelPosition"
      label-width="150px"
      :model="ruleForm"
    >
      <el-form-item label="来访人:" >
        <p style="width: 750px">{{ ruleForm.visitor.username}}</p>
      </el-form-item>
      <el-form-item label="来访人电话:">
        <p style="width: 800px">{{ ruleForm.visitor.mobile }}</p>
      </el-form-item>
      <el-form-item label="来访人身份证号:">
        <p style="width: 800px">{{ ruleForm.visitor.card }}</p>
      </el-form-item>
      <el-form-item label="来访人车牌号:">
        <p style="width: 750px">{{ruleForm.visitor.carnumber}}</p>
      </el-form-item>
      <el-form-item label="来访是由:">
        <p style="width: 750px">{{ ruleForm.visitor.reason }}</p>
      </el-form-item>
      <el-form-item label="来访开始时间:">
        <p style="width: 750px">{{ ruleForm.visitor.starttime}}</p>
      </el-form-item>
      <el-form-item label="来访结束时间:">
        <p style="width: 750px">{{ ruleForm.visitor.endtime }}</p>
      </el-form-item>
      <el-form-item label="来访登记时间:">
        <p style="width: 750px">{{ ruleForm.visitor.addtime}}</p>
      </el-form-item>
        <el-form-item label="审批人:">
        <p style="width: 750px">{{ ruleForm.username}}</p>
      </el-form-item>
        <el-form-item label="审批状态:">
        <p style="width: 750px">{{ruleForm.status}}</p>
      </el-form-item>
    </el-form>
       </div>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import http from "../utils/http";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  props: {},
  data() {
    //这里存放数据
    return {
      travelcode:"",
      labelPosition: "right",
      ruleForm: {
          username: "",
        status: "",
        v_id: "",
        visitor: [
          {
            username: "",
            mobile: "",
            card: "",
            carnumber: "",
            reason: "",
            starttime: "",
            endtime: "",
            addtime: "",
          },
        ],
      },
      logid: this.$route.params.id,
      imgsVisible: false, //默认弹窗属性是隐藏的
    };
  },
  //计算属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    goBack() {
      this.$router.back();
    },
    async xiangq() {
    let res = await http.get("/api/visit/auditlog/show?id=" + this.logid);
      if (res.code == "00000") {
        this.ruleForm = res.data;
      }
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    this.xiangq();
    // console.log('created', this.$route)
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    this.logid = this.$route.params.id;
    // console.log(this.data);
    console.log("mounted", this.$route.params.id);
  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped>

</style>